@extends('layout.admin')
@section('content')

        <!-- 内容区域 -->
        <div class="tpl-content-wrapper">

            <div class="container-fluid am-cf">


 

                <div class="row">

                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                        <div class="widget am-cf">
                            <div class="widget-head am-cf">
                                <div class="widget-title am-fl">修改信息</div>
                                <div class="widget-title am-fl"><?php   ?></div>
                                <div class="widget-function am-fr">
                                    <a href="javascript:;" class="am-icon-cog"></a>
                                </div>
                            </div>
                            <div class="widget-body am-fr">

                                <form class="am-form tpl-form-border-form" action="/newsedit" method="POST" enctype="multipart/form-data">
                                   
                                 {!! csrf_field() !!}
                                 <?php  $id=session('homeInfo')->id; ?>
            <input type="hidden" value="<?php echo $id; ?>" name="id">
                                    <div class="am-form-group">
                                        <label for="user-name" class="am-u-sm-12 am-form-label am-text-left">店名 <span class="tpl-form-line-small-title"></span></label>
                                        <div class="am-u-sm-12">
                                            <input type="text" name="name" required="required" class="tpl-form-input am-margin-top-xs" id="user-name" placeholder="{{$data['0']->name}}" value="{{$data['0']->name}}">
                                            <small>请填写标题文字10-20字左右。</small>
                                        </div>
                                    </div>

                                     <div class="am-form-group">
                                        <label for="user-name" class="am-u-sm-12 am-form-label am-text-left">地址 <span class="tpl-form-line-small-title"></span></label>
                                        <div class="am-u-sm-12">
                                            <input type="text" name="address" required="required" class="tpl-form-input am-margin-top-xs" id="user-name" placeholder="{{$data['0']->address}}" value="{{$data['0']->address}}">
                                            <small>地址必须填写</small>
                                        </div>
                                    </div>

                                     <div class="am-form-group">
                                        <label for="user-name" class="am-u-sm-12 am-form-label am-text-left">公告<span class="tpl-form-line-small-title"></span></label>
                                        <div class="am-u-sm-12">
                                            <input type="text" name="notice" required="required" class="tpl-form-input am-margin-top-xs" id="user-name" placeholder="{{$data['0']->notice}}" value="{{$data['0']->notice}}">
                                            <small>请填写最新消息</small>
                                        </div>
                                    </div>

                                    <div class="am-form-group">
                                        <label for="user-name" class="am-u-sm-12 am-form-label am-text-left">派送方式<span class="tpl-form-line-small-title"></span></label>
                                        <div class="am-u-sm-12">
                                            <input type="text" name="send" required="required" class="tpl-form-input am-margin-top-xs" id="user-name" placeholder="{{$data['0']->send}}" value="{{$data['0']->send}}">
                                            <small>请填写派送范围，价钱等事项</small>
                                        </div>
                                    </div>





                                    <div class="am-form-group">
                                        <label for="user-intro" class="am-u-sm-12 am-form-label  am-text-left">店铺简介</label>
                                        <div class="am-u-sm-12 am-margin-top-xs">
                                            <textarea class="" required="required" name="intro" rows="10" id="user-intro" placeholder="{{$data['0']->intro}}">{{$data['0']->intro}}</textarea>
                                        </div>
                                    </div>

                                    <div class="am-form-group">
                                        <div class="am-u-sm-12 am-u-sm-push-12">
                                            <button type="submit" class="am-btn am-btn-primary tpl-btn-bg-color-success ">提交</button>
                                        </div>
                                    </div>
                                     </form>
 
                 <hr>
                                                 <div style="height:50px;width:30px;float:left;"></div>

                                  <form action="/photoedit"  id="photoForm" method="POST" enctype="multipart/form-data">

                                   {!! csrf_field() !!}
                                     <div class="am-form-group">
                                        <label for="user-weibo" class="am-u-sm-12 am-form-label  am-text-left">logo图片 <span class="tpl-form-line-small-title"></span></label>
                                        <div class="am-u-sm-12 am-margin-top-xs">
                                            

                                                <input type="hidden"  value="<?php echo session('homeInfo')->id; ?>" name="id">

                                                  
                                               
                                     
    
                                                <input  name="photo" required="required" type="file" multiple=""><br>

                                                <input type="button" value="预览" onclick="loo()">

                                               <br><br>

                                            <div style="height:200px;width:200px;border:bink solid 2px;">
                                      
                                                <img id="avatar_url" src="/{{$data['0']->photo}}" height="200px" width="200px">
                                        </div><br>

                                          <input type="submit" value="提交">

<hr>

                                        </div>
                                      
                                    </div>

                                    
 
 

                                  </form>
     
                                    <div style="height:50px;width:30px;float:left;"></div>
                                  <form action="/aptitudeedit"  id="photoForm2" method="POST" enctype="multipart/form-data">
                                   {!! csrf_field() !!}
                                     <div class="am-form-group">
                                        <label for="user-weibo" class="am-u-sm-12 am-form-label  am-text-left">资质图片 <span class="tpl-form-line-small-title"></span></label>
                                        <div class="am-u-sm-12 am-margin-top-xs">
                                            
                                                
                                                      <input type="hidden"  value="<?php echo session('homeInfo')->id; ?>" name="id">
                                               
                                     
    
                                                <input id="doc-form-file" required="required" name="aptitude" type="file" multiple=""><br>

                                             <input type="button" value="预览" onclick="loo2()">

                                               <br><br>

                                            <div style="height:200px;width:200px;border:bink solid 2px;">
                                      
                                                <img id="avatar_url2" src="/{{$data['0']->aptitude}}" height="200px" width="200px">
                                        </div><br>
                                          <input  type="submit" value="提交">
<hr>

                                        </div>
                                      
                                    </div>

                                    
 
 

                                  </form>

                               
                            </div>
                        </div>
                    </div>
                </div>


            </div>
        </div>
    </div>
    </div>

<script>

 $.ajaxSetup({
        headers: { 'X-CSRF-TOKEN' : '{{ csrf_token() }}' }
    });
   function loo(){
    var formData = new FormData($("#photoForm")[0]);
       
        $.ajax({
            url: "{{url('/look')}}",
            type: 'POST',
            data: formData,
            contentType: false,
            processData: false,
            success: function (returndata) {
               
                $("#avatar_url").attr('src',returndata);
            },
            error: function (returndata) {
                console.log(returndata);
            }
        });
   }

      function loo2(){
    var formData = new FormData($("#photoForm2")[0]);
       
        $.ajax({
            url: "{{url('/look2')}}",
            type: 'POST',
            data: formData,
            contentType: false,
            processData: false,
            success: function (returndata) {
            
                $("#avatar_url2").attr('src',returndata);
            },
            error: function (returndata) {
                console.log(returndata);
            }
        });
   }
</script>

@endsection